import { CHANGE_INPUT_VALUE, ADD_TODO_ITEM, DELETE_ITEM, INIT_DATA, GET_INIT_LIST } from './actionTypes';

export const getInputChangeAciton = (value) => ({
  type: CHANGE_INPUT_VALUE,
  value
})

export const getAddItemAciton = () => ({
  type: ADD_TODO_ITEM
})

export const getDeleteItemAciton = (index) => ({
  type: DELETE_ITEM,
  index
})

export const getInitAction = (data) => ({
  type: INIT_DATA,
  data
})

export const getInitListAction = () => ({
  type: GET_INIT_LIST
})

// export const getListAction = () => {
// 	return (dispatch) => {
// 	  axios.get('/list.json').then((res) => {
// 	      const data = res.data;
// 	      const action = getInitAction(data);
// 	      dispatch(action);
//     })
// 	}
// }
